local fenpo = fk.CreateSkill {
  name = "lingling__fenpo",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["lingling__fenpo"] = "分破",
  [":lingling__fenpo"] = "锁定技，你的回合内，只有你和濒死状态的角色能使用【桃】。",
}

fenpo:addEffect(fk.EnterDying, {
  can_refresh = function(self, event, target, player, data)
    return player:hasSkill(fenpo.name) and player.room.current == player
  end,
  on_refresh = function(self, event, target, player, data)
    player.room:notifySkillInvoked(player, fenpo.name, "offensive")
    player:broadcastSkillInvoke(fenpo.name)
  end,
})

fenpo:addEffect("prohibit", {
  prohibit_use = function(self, player, card)
    if Fk:currentRoom().current:hasSkill(fenpo.name) then
      return card.name == "peach" and not player.dying and Fk:currentRoom().current ~= player
    end
  end,
})

return fenpo
